<template>
  <div class="home">
    <!-- 下一步 -->
    <!-- <div class="main-title row">
      <div style="width: 20%">新增日考勤人员</div>
       <div style="width: 80%; text-align: right; margin-right: 20px">
        <el-button class="sub-btn" @click="cancle">取消</el-button>
        <el-button class="sub-btn color-1abc9c" @click="next">{{
          active >= 2 ? "完成" : "下一步"
        }}</el-button>
      </div>
    </div> -->
    <!-- 新增日考勤 步骤条-->
    <div class="table-panel">
    <div class="steps">
      <el-steps :active="active">
        <el-step>
          <template slot="title">
            <div class="steps-title">选择人员</div>
          </template>
          <template slot="description">
            <div>已选{{ personnelList.length }}人</div>
          </template>
        </el-step>
        <el-step>
          <template slot="title">
            <div class="steps-title">设置考勤</div>
          </template>
          <template slot="description">
            <div>设置相关人员考勤</div>
          </template>
        </el-step>
        <el-step>
          <template slot="title">
            <div class="steps-title">考勤确认</div>
          </template>
          <template slot="description">
            <div>同步考勤信息</div>
          </template>
        </el-step>
      </el-steps>
    </div>
    <div class="components-body">
      <select-personnel
        v-show="active == 0"
        @selectPersonnel="selectPersonnel"
        @getActive="getActive"
      ></select-personnel>
      <setting-attendance
        v-show="active == 1"
        :personnelList="personnelList"
        @getActive="getActive"
      ></setting-attendance>
      <confirm-attendance v-show="active >= 2" :personnelList="personnelList" @getActive="getActive"></confirm-attendance>
    </div>

    <!-- 下一步 -->
    <!-- <div
      class="main-title row"
      style="background-color: #ffffff; border-top: solid 1px #e4e4e4"
    >
      <div style="width: 100%; text-align: right; margin-right: 20px">
        <el-button class="sub-btn" type="info" @click="cancle">取消</el-button>
        <el-button class="sub-btn color-1abc9c" @click="next">{{
          active >= 2 ? "完成" : "下一步"
        }}</el-button>
      </div>
    </div> -->
    </div>
  </div>
</template>

<script>
import SelectPersonnel from "./components/selectPersonnel.vue";
import SettingAttendance from "./components/settingAttendance.vue";
import ConfirmAttendance from "./components/confirmAttendance.vue";
export default {
  components: { SelectPersonnel, SettingAttendance, ConfirmAttendance },
  data() {
    return {
      active: 0,
      buttonTag: "下一步",
      personnelList: [],
      attendanceInfo:{},
    };
  },
  created() {
    //   this.$store.attendance.addPersonnelList
    //   console.log(this.$store.state.attendance.addPersonnelList)
    // this.$store.commit('updateList',[2,2,2])
  },
  methods: {
    selectPersonnel(res) {
      this.personnelList = res;
      // console.log(this.personnelList)
    },
    getActive(active){
      this.active = active
      // console.log(this.active)
    }
  },
};
</script>

<style lang="scss" >
.steps {
  min-height: 100px;
  background-color: #ffffff;
  padding: 50px 0;
  border-bottom: solid 1px #e4e4e4;
  .el-steps {
    width: 80%;
    margin: 0 auto;
  }
  .el-step__line {
    margin-left: 100px;
  }
  .is-success {
    border-color: #1abc9c;
    color: #1abc9c;
  }
  .el-step__main {
    margin-left: 30px;
    margin-top: -30px;
    .el-step__title {
      font-weight: bold;
    }
  }
}
.row {
  display: flex;
  flex-direction: row;
}
.color-1abc9c {
  background-color: #1abc9c;
  color: #ffffff;
}
.main-title {
  height: 50px;
  text-align: left;
  padding-left: 20px;
  font-size: 12px;
  line-height: 50px;
  background-color: #f3f3f3;
  .sub-btn {
    margin-top: 5px;
    width: 80px;
    height: 40px;
    line-height: 40px;
    padding-top: 0;
  }
}
</style>